Skip to content

Conversation

@Ansonhkg
Copy link
Contributor

@Ansonhkg Ansonhkg commented Feb 27, 2025

WHAT

This is an experimental implementation of EIP 7702. It provides 2 examples of generating the EIP-7702 authorisation tuple:

Using the PKP:

const authTuple = await signEip7702Auth({
  pkpPublicKey: params.pkpPublicKey,
  targetAddress: TARGET_ADDRESS,
  chainId: 1,
});

Using the private key via the Viem modified privateKeyToAccount function:

const privateKey =
  "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" as Hex; // Example private key

const authTuple = await signEip7702AuthViem({
  privateKey,
  targetAddress: TARGET_ADDRESS,
  chainId: 1n,
  nonce: 0n,
});

Note: We are also bundling the Viem functionalities on Lit Action

Screenshot

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants